package com.yzd.learnjava.iniialization;

public class PassingThis {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		new Person().eat(new Apple());
	}

}


class Apple{
	boolean isPeel = false;
	Apple getPeeled(){
		return Peeler.peel(this);
	}
}

class Peeler{
	static Apple peel(Apple apple){
		System.out.println("peel apple");
		apple.isPeel = true;
		return apple;
	}
}

class Person{
	public void eat(Apple apple){
		Apple peeled = apple.getPeeled();
		System.out.println("eat apple, Yummy!");
	}
}